import request from '@/router/axios';



export const getList = (current, size,params) => {
  return request({
    url: '/api/hg-public/material/info/page2',
    method: 'get',
    params: {
      ...params,
      current,
      size,
    }
  })
}
export const getPointList = (current, size,materialId) => {
  return request({
    url: '/api/hg-public/material/materialnode/page',
    method: 'get',
    params: {
      materialId,
      current,
      size,
    }
  })
}
export const getNodeList = (current, size,params) => {
  return request({
    url: '/api/blade-produce/blade-basic/node/page',
    method: 'get',
    params: {
      ...params,
      current,
      size,
    }
  })
}
export const add = (row) => {
  return request({
    url: '/api/hg-public/material/info/save',
    method: 'post',
    data: row
  })
}
export const addPoint = (data) => {
  return request({
    url: '/api/hg-public/material/materialnode/submit',
    method: 'post',
    data
  })
}
export const update = (row) => {
  return request({
    url: '/api/hg-public/material/info/update',
    method: 'post',
    data: row
  })
}

export const remove = (ids) => {
  return request({
    url: '/api/hg-public/material/info/delete',
    method: 'post',
    params: {
      ids,
    }
  })
}


export const getRuleList = (current, size,params) => {
  return request({
    url: '/api/hg-quality/quality/rule/list',
    method: 'get',
    params: {
      ...params,
      current,
      size,
    }
  })
}


export const getRule = (code) => {
  return request({
    url: '/api/hg-quality/quality/rule/get-by-code',
    method: 'get',
    params: {
      code,
    }
  })
}

export const getUnit = (unitId) => {
  return request({
    url: '/api/hg-logistics/unit/info',
    method: 'get',
    params: {
      "id":unitId
    }
  })
}

export const getUnitList = (current, size,params) => {
  return request({
    url: '/api/hg-public/unit/list',
    method: 'get',
    params: {
      ...params,
      current,
      size,
    }
  })
}



export const getInfo = (id) => {
  return request({
    url: '/api/hg-public/material/info/info2',
    method: 'get',
    params: {
      id,
    }
  })
}

export const getProductGroup = (id) => {
  return request({
    url: '/api/blade-produce/blade-basic/productgroup/detail',
    method: 'get',
    params: {
      id,
    }
  })
}


export const getProductGroupList = (current, size,params) => {
  return request({
    url: '/api/blade-produce/blade-basic/productgroup/page',
    method: 'get',
    params: {
      ...params,
      current,
      size,
    }
  })
}
